﻿using System;
using System.Collections;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using System.Collections.Generic;
using Huirui.Cavan.Domain.Seedwork;
using Huirui.Cavan.Domain.MainBoundedContext.StockModule;

namespace Huirui.Cavan.Domain.MainBoundedContext.SalesModule
{
    #region SalesReturn

    /// <summary>
    /// SalesReturn object for NHibernate mapped table 'SalesReturn'.
    /// </summary>
    [Serializable]
    public class SalesReturn : Persistent<string>
    {
        #region Member Variables

        protected DateTime _returnDate;
        protected string _deliveryCode;
        protected string _currency;
        protected decimal _currencyRate;
        protected decimal _taxRate;
        protected string _salesCode;
        protected string _deliveryAddress;
        protected string _checkCode;
        protected string _remark;
        protected string _contact;
        protected string _contactTelephone;
        protected Corporation _corporation;
        protected Customer _customer;
        protected Employee _saleEmployee;
        protected Project _project;
        protected WareHouse _wareHouse;
        protected StockInOut _stockInOut;

        #endregion

        #region Constructors

        public SalesReturn() { }

        public SalesReturn(string id, DateTime returnDate, string deliveryCode, string currency, decimal currencyRate, decimal taxRate, string salesCode, string deliveryAddress, 
            string checkCode, string remark, DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation, Customer customer, Employee saleEmployee,
            Project project, WareHouse wareHouse, string contact, string contactTelephone)
        {
            this.Id = id;
            this._returnDate = returnDate;
            this._deliveryCode = deliveryCode;
            this._currency = currency;
            this._currencyRate = currencyRate;
            this._salesCode = salesCode;
            this._deliveryAddress = deliveryAddress;
            this._checkCode = checkCode;
            this._remark = remark;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
            this._customer = customer;
            this._saleEmployee = saleEmployee;
            this._project = project;
            this._wareHouse = wareHouse;
            this._contact = contact;
            this._contactTelephone = contactTelephone;
            this._taxRate = taxRate;
        }

        #endregion

        #region Public Properties


        public virtual DateTime ReturnDate
        {
            get { return _returnDate; }
            set { _returnDate = value; }
        }

        public virtual string DeliveryCode
        {
            get { return _deliveryCode; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryCode", value, value.ToString());
                _deliveryCode = value;
            }
        }

        public virtual string Currency
        {
            get { return _currency; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for CurrencyCode", value, value.ToString());
                _currency = value;
            }
        }

        public virtual decimal CurrencyRate
        {
            get { return _currencyRate; }
            set { _currencyRate = value; }
        }

        public virtual decimal TaxRate
        {
            get { return _taxRate; }
            set { _taxRate = value; }
        }

        public virtual string SalesCode
        {
            get { return _salesCode; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for SalesCode", value, value.ToString());
                _salesCode = value;
            }
        }

        public virtual string DeliveryAddress
        {
            get { return _deliveryAddress; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryAddress", value, value.ToString());
                _deliveryAddress = value;
            }
        }

        public virtual string CheckCode
        {
            get { return _checkCode; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for CheckCode", value, value.ToString());
                _checkCode = value;
            }
        }

        public virtual string Contact
        {
            get { return _contact; }
            set
            {
                _contact = value;
            }
        }

        public virtual string ContactTelephone
        {
            get { return _contactTelephone; }
            set
            {
                _contactTelephone = value;
            }
        }

        public virtual string Remark
        {
            get { return _remark; }
            set
            {
                _remark = value;
            }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        public virtual Customer Customer
        {
            get { return _customer; }
            set { _customer = value; }
        }

        public virtual Employee SaleEmployee
        {
            get { return _saleEmployee; }
            set { _saleEmployee = value; }
        }

        public virtual Project Project
        {
            get { return _project; }
            set { _project = value; }
        }

        public virtual WareHouse WareHouse
        {
            get { return _wareHouse; }
            set { _wareHouse = value; }
        }

        public virtual StockInOut StockInOut
        {
            get { return _stockInOut; }
            set { _stockInOut = value; }
        }
        #endregion
    }
    #endregion
}